{template 'common/header'}
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo $this->createWebUrl('record');}">全部充值记录</a></li>
	<!--<li><a href="{php echo $this->createWebUrl('orderoutput');}">导出数据</a></li>-->
</ul>
<div class="main">
<div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="feng_recharge" />
			<input type="hidden" name="do" value="order" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">订单号</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}" placeholder="可查询订单号">
				</div>
			</div> 
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">支付状态</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					<select name="paytype" class="form-control">
						<option value="">不限</option>
						{loop $paytype $key $type}
						<option value="{$key}" {if $_GPC['paytype'] == $key} selected="selected" {/if}>{$type['name']}</option>
						{/loop}
					</select>
				</div>
			</div>
			<div class="form-group">
					<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">下单时间</label>
					<div class="col-sm-7 col-lg-9 col-xs-12">
						{php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
					</div>
					<div class="col-sm-3 col-lg-2"><button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button></div>
				</div>
			<div class="form-group">
			</div>
		</form>
	</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-heading">充值记录</div>
		<div class="panel-body">
			<div class="table-responsive panel-body">
				<table class="table table-hover" style="min-width: 300px;">
					<thead class="navbar-inner">
						<tr>
							<th class="col-sm-1">订单号</th>
							<th class="col-sm-2">用户OPENID</th>
							<th class="col-sm-1">支付方式</th>
							<th class="col-sm-2">微信订单号</th>
							<th class="col-sm-1">充值金额</th>
							<th class="col-sm-1">状态</th>
							<th class="col-sm-2">下单时间</th>
							<th class="col-sm-1 text-right">操作</th>
						</tr>
					</thead>
					<tbody>
						{loop $goodses $goodsid $goods}
						<tr>
							<td>{$goods['ordersn']}</td>
							<td>{$goods['from_user']}</td>
							<td>{if ($goods['paytype']<3)}{if ($goods['paytype']==1)}<span class="label label-danger">余额支付{else}{if ($goods['paytype']==2)}<span class="label label-danger">微信支付{else}<span class="label label-default">未支付{/if}{/if}{else}<span class="label label-danger">支付宝支付{/if}</span</td>
							<td>{$goods['transid']}</td>
							<td>{$goods['price']} 元</td>
							<td>{if ($goods['status']==1)}<span class="label label-info">已支付</span>{else}{if ($goods['status']==2)}<span class="label label-danger">已完成</span>{else}<span class="label label-default">未支付</span>{/if}{/if}</td>
							<td>{php echo date('Y-m-d H:i:s', $goods['createtime'])}</td>
							<td class="text-right">
							{if ($goods['status']==1)}
								<a href="{php echo $this->createWebUrl('order', array('op'=>'set','id'=>$goods['id']));}" class="btn btn-success btn-sm" data-original-title="" title="">充值成功</a>
							{else}
							{if ($goods['status']==2)}
								<a href="#" class="btn btn-success btn-sm" data-original-title="" title="">充值成功</a>
							{else}
								<a href="#" class="btn btn-danger btn-sm" data-original-title="" title="">未支付</a>
							{/if}
							{/if}
								<a href="{php echo $this->createWebUrl('order',array('op'=>'delete','id'=>$goods['id']));}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-times"></i></a>
							</td>
						</tr>
						{/loop}
						{if empty($goodses)}
						<tr>
							<td colspan="8">
								没有充值记录
							</td>
						</tr>
						{/if}
					</tbody>
				</table>
				{$pager}
			</div>
		</div>
		</div>
	</div>
</div>
{template 'common/footer'}